singleton pattern

[ˈsɪŋɡltən ˈpætn]
  • 网络

    单例模式;单件模式

数据更新时间:2026-04-19 15:05:55
1、

As its name suggests, the Singleton Pattern is typically used when you want only one instance of a particular class.

如其名称所暗示的,当您想要特别类的仅仅一个实例时,才使用Singleton模式。

互联网摘选

2、

Using C# 2.0 Generics to achieve a reusable Singleton pattern

使用C2.0泛型来完成单例模式的重用

互联网摘选

3、

Create two methods for the Singleton Pattern: The constructor is private, and there is one public method called getInstance().

为Singleton模式创建两个方法:构造函数是私有的,且有一个公有的方法,称为getInstance()。

互联网摘选

4、

The Practice of Using Singleton Pattern in. NET

单件模式在.NET中的应用实践

互联网摘选

5、

In the program the author apply observer pattern, composite pattern, factory pattern and singleton pattern.

在系统中使用了观察者模式、合成模式、简单工厂模式和单例模式。

互联网摘选

6、

Drag and drop the Singleton Pattern instance from the Pattern Explorer into the UML Class Diagram view.

将Singleton模式实例从模式浏览器中拖拽到UML类图视图中。

互联网摘选

7、

Create a private attribute for the Singleton Pattern called_instance.

为Singleton模式创建私有属性,称为instance。

互联网摘选

8、

The singleton pattern is probably one of the most often used OOP design patterns; it restricts the number of object instances of a class to one.

单例模式可能是最常用的OOP设计模式之一了;它限制了一个类的对象实例数只能为1。

互联网摘选

9、

Implementing and application of the Singleton pattern in VB

Singleton模式在VB中的实现和应用

互联网摘选

10、

This setup means that no matter which thread uses this class in the Singleton Pattern, whenever that public method is called, it should output the same value.

这个测试类的意思就是不论那个线程在任何时候,在单例下调用这个类公共方法,都将返回相同的值。

互联网摘选

11、

To facilitate this, the plug-in class implements the singleton pattern: It stores a reference to itself in a private class variable.

为了使这一点更方便,插件类实现单模式(singleton pattern):它在私有类变量中存储一个自身的引用。

互联网摘选

12、

The framework adopts object broker in singleton pattern to implement data access, effectively enhances the efficiency of connection;

框架采用了单实例的对象代理来实现数掘访问,有效地提高了连接操作的效率;

互联网摘选

13、

Agricultural Expert System Platform is characterized by complexity. The paper applies Strategy Pattern, Composite Pattern, Command Pattern, Singleton Pattern and Facade Pattern to the system.

鉴于农业专家平台系统的复杂性,论文提出了运用策略模式、组合模式、命令模式、单例模式以及门面模式构建农业专家系统。

互联网摘选

14、

The Singleton pattern applies to situations in which there needs to be a single instance of a class.

单例模式支持那些需要只保存一个单独的实例的类。

互联网摘选

15、

Using the Singleton pattern we guarantee that no matter how many times the BusinessLayerProxy tries to create a CommandFactory, only one instance will exist.

使用Singleton模式,我们可以保证无论BusinessLayerProxy多少次尝试建立CommandFactory,也只存在一个实例。

互联网摘选

16、

The singleton pattern ensures that only a single instance of a class is normally used by an application, but still allows alternate instances to be created as required.

单元素模式可以确保应用程序通常只使用类的单个实例,但是仍然允许根据需要创建备用实例。

互联网摘选

17、

If we follow a straight singleton pattern for PoIdGenerator, this can be problematic.

如果我们使用PoIdGenerator的直接单一模式,可能会出现问题。

互联网摘选

18、

Using some excellent designs patterns in the design, such as factory model, proxy pattern and singleton pattern.

同时,在设计体系架构时,使用了一些优秀的设计模式,如工厂模式,代理模式、单例模式等。

互联网摘选

19、

This is a standard PHP singleton pattern.

这是一个标准的PHP单元素模式。

互联网摘选

20、

The singleton pattern can be used to delay the initialization of an object as long as possible.

单元素模式可以用来尽可能久地延迟对象的初始化。

互联网摘选

21、

In the case of eg.a singleton pattern using the constructor this can have severe consequences and lead to seemingly random null reference exceptions.

单一模式使用构造函数可能会导致严重后果,会带来类似随机的空参数异常。

互联网摘选

22、

The singleton pattern is baked directly into Scala and is used anywhere you would use static methods or variables in the Java language.

单例模式被直接内置在Scala中,可以替代Java语言中的静态方法或变量。

互联网摘选

23、

To create an instance of the Factory Method Pattern, perform the same steps as for the Singleton Pattern.

要创建Factory方法模式的实例,执行同Singleton模式相同的步骤。

互联网摘选

24、

Singleton pattern makes construction method of the class protected, and ensures only one instance to be created.

Singleton模式把类的构造方法隐藏在静态方法后面,保证系统中仅有1个类的实例被创建。

互联网摘选

25、

Doing so creates an instance of the Singleton Pattern in the Model Explorer.

执行此操作将会在模型浏览器中生成一个Singleton模式的实例。

互联网摘选

26、

Through this functionality, you can use the popular singleton pattern.

通过使用这种功能,您可以使用流行的单例模式。

互联网摘选

27、

Many people from different programming backgrounds should be familiar with the Singleton Pattern.

很多有着不同开发背景得人都会比较熟悉单例模式。

互联网摘选

28、

However, the project had two closely related scenarios where the singleton pattern proved useful: for logging and exception handling.

不过本项目中有两个紧密相关的场景可以证明独立模式是有用的:可以用于日志记录和异常处理。

互联网摘选

29、

You use this function to initialize static variables, enforce the singleton pattern, or perform any other necessary work before a class is usable.

你可以用这个函数来初始化静态成员变量,强制使用单例模式,或者实现其它任何在类型的实例可用前应该完成的工作。

互联网摘选

30、

Most caches are implemented using the Singleton pattern involving a static reference to a top level Cache class as shown in this example.

使用Singleton模式实现的大多数缓存都涉及本例所示的对顶级Cache类的静态引用。

互联网摘选

  • 相关词组
  • 今日热词
  • 热门搜索

微语录(www.volg.cn)为您提供在线词典、英语翻译、单词大全、英译汉、汉译英等英语服务!可通过lj:关键词格式搜索句子,如lj:affect,搜索affect相关的双语例句!

用户反馈
请选择反馈类型(可多选):
您的联系方式:(如需回复请填写联系方式)
反馈内容:
提交成功 小编会尽快处理
回到顶部
点击反馈